﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using SalesSys.BLL;
using SalesSys.Comm.Utility;
using SalesSys.DAL.Models;

namespace SalesSys.Site.Controllers.Api
{
    /// <summary>
    /// 流程
    /// </summary>
    [RoutePrefix("api/SequenceApproval")]
    public class SequenceApprovalController : BaseApiController
    {
        private SequenceApprovalBLL seqBll = new SequenceApprovalBLL();

        /// <summary>
        /// 新建流程
        /// </summary>
        /// <param name="item">流程节点实体</param>
        [Route("AddItem")]
        public IResultState AddItem(SequenceApprovalItem item)
        {
            return seqBll.AddItem(item);
        }

        /// <summary>
        /// 删除流程
        /// </summary>
        /// <param name="itemId">流程项编号</param>
        /// <returns></returns>
        [Route("DeleteItem")]
        public IResultState DeleteItem(Guid itemId)
        {
            return seqBll.DeleteItem(itemId);
        }

        /// <summary>
        /// 编辑流程
        /// </summary>
        /// <param name="item">流程项实体</param>
        /// <returns></returns>
        [Route("EditItem")]
        public IResultState EditItem(SequenceApprovalItem item)
        {
            return seqBll.EditItem(item);
        }
    }
}
